<!--用户管理页-->
<template>
  <div style="height: 6vh;background-color: #fff;padding: 10px 20px">
    <span style="font-size: 20px;line-height: 60px">用户管理</span>
    <el-button type="primary" style="float: right;margin-top: 10px">新建用户</el-button>
  </div>
<!-- 用户搜索卡片 -->
  <el-card style="height: 70px;margin: 10px;">
    <el-form :inline="true">
      <el-form-item label="用户搜索">
        <el-input placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item label="用户状态" style="width: 270px;">
        <el-select placeholder="请选择用户状态">
          <el-option label="启用" value="1"></el-option>
          <el-option label="禁用" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button @click="reset">重置</el-button>
        <el-button type="primary">查询</el-button>
      </el-form-item>
    </el-form>
  </el-card>

<!--  用户表格卡片-->
  <el-card style="margin: 10px;">
    <el-table :data="userArr">
      <el-table-column type="index" label="编号" align="center" width="80"></el-table-column>
      <el-table-column prop="username" label="姓名" align="center"></el-table-column>
      <el-table-column prop="phone" label="手机号" align="center"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
      <el-table-column prop="status" label="状态" align="center">
        <template #default="scope">
          <el-switch v-model="scope.row.status" active-value="1" inactive-value="0"></el-switch>
        </template>
      </el-table-column>
      <el-table-column align="center" label="操作">
        <template #default="scope">
          <el-button type="primary" link>密码重置</el-button>
          <el-button type="primary" link>编辑</el-button>
          <el-button type="danger" link>删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script setup>
import {ref} from "vue";

// 定义一个数组保存用户数据
const userArr = ref([
  {username:'jack',phone:'19999999999',createTime:'2022-02-02',status:'1'},
  {username:'tom',phone:'19999999999',createTime:'2022-02-02',status:'0'},
]);

const reset = ()=>{

}

</script>

<style scoped>

</style>